package cn.edu.ctbu.datajpa2.Service;

import cn.edu.ctbu.datajpa2.domain.Student;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface StudentService {
   List<Student> findAll();

    /**
     * 分页查询
     * @param pageable
     * @return
     */
   Page<Student> findAll(Pageable pageable);

    /**
     * 过滤分页
     * @param student
     * @param pageable
     * @return
     */
   public Page<Student> findAll(Example<Student> student, Pageable pageable);

    Student findById(Integer id);
  List<Student> findByName(String name);
  List<Student> findByNameAndPassword(String name,String password);


    Student insert(Student student);

     Student update(Student student) ;
    void delete(Student student) ;
    void delete(Integer id);

    Student getById(Integer id);

   void add(Student student);

    // void add(Student student);
}

